package collection1;

import javax.lang.model.type.ArrayType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 *增强 for循环
 */
public class NewForDemo {
    public static void main(String[] args) {
        Collection<point1> c =new ArrayList<>();
        c.add(new point1(1,2));
        c.add(new point1(3,4));
        c.add(new point1(5,6));
        c.add(new point1(7,8));















        /*String[] array = {"one","two","three","four","five"};

        for (int i=0;i<array.length;i++){
            System.out.println(array[i]);
        }

        for (String str: array){
            System.out.println(str);
        }

        Collection c= new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        Iterator it = c.iterator();
        while (it.hasNext()){
            String str = (String) it.next();
            System.out.println(str);
        }
        for (Object obj : c){
            String str = (String) obj;
            System.out.println(str);
        }
        for (Object o : c) {
            String str = (String) o;
            System.out.println(str);
        }
        */

    }
}
